import request from '../../utils/Request'
import PageUtils from '../../utils/PageUtils'


export const listUserByOrgId = bId => {
    return request({
        method: 'get',
        url: '/api/platform/user/list/org/' + bId,
        params: {}
    })
}

export const saveUser = data => {
    return request({
        method: 'post',
        url: '/api/platform/user/save',
        data: data
    })
}

export const createUser = data => {
    return request({
        method: 'post',
        url: '/api/platform/user/create',
        data: data
    })
}

export const updateUser = data => {
    return request({
        method: 'post',
        url: '/api/platform/user/update',
        data: data
    })
}

export const updateUserPassword = data => {
    return request({
        method: 'post',
        url: '/api/platform/user/update/password',
        data: data
    })
}

export const    resetUserPassword = bid => {
    return request({
        method: 'get',
        url: '/api/platform/user/reset/password/' + bid,
        params: {}
    })
}

export const deleteUser = bId => {
    return request({
        method: 'get',
        url: '/api/platform/user/delete/' + bId,
        params: {}
    })
}


export const listUser = data => {
    return request({
        method: 'get',
        url: '/api/platform/user/list',
        params: data
    })
}

export const  listUserBuildingId = bid => {
    return request({
        method: 'get',
        url: '/api/platform/user/list/building/' + bid,
        params: {}
    })
}

export const  listUserByRoomId = bid => {
    return request({
        method: 'get',
        url: '/api/platform/user/list/room/' + bid,
        params: {}
    })
}

export const  listUserByCode = code => {
    return request({
        method: 'get',
        url: '/api/platform/user/list/code/' + code,
        params: {}
    })
}
